//艺术与篮球日期问题
#include<bits/stdc++.h>
using namespace std;

int months[]={0,31,28,31,30,31,30,31,31,30,31,30,31};
int cnt[] = {13,1,2,3,5,4,4,2,2,2};



bool isleap(int year)
{
	return (year%4==0 && year%100!=0) || (year%400==0);
}
//判断是否超过50
bool isgreater(int year,int month,int day)
{
	string s = to_string(year);
	if(month < 10) s += '0';
	s += to_string(month);
	if(day < 10) s += '0';
	s += to_string(day);
	int sum = 0;
	for(int i = 0; i < s.size(); i++)
	{
		sum += cnt[s[i] - '0'];
	}
	if(sum>50)
		return true;
	return false;
}
int main()
{
	int endyear = 2024,endmonth = 4,endday = 13;
	int year = 2000,month = 1,day = 1;
	
	int count = 0;
    for(;year <= endyear;year++)
	{
		if(isleap(year))
			months[2] = 29;
		else
			months[2] = 28;
		for(month = 1;month <= 12;month++)
		{
			
			for(day = 1;day <= months[month];day++)
			{
				if(isgreater(year,month,day))
					count++;
				if(year==endyear && month==endmonth && day==endday)
				{
					cout<<count;
					return 0;
				}
					
			}
		}
	}
	return 0;
}
